/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package democarmanagement;

import com.mysql.jdbc.Connection;
import java.sql.Statement;

/**
 *
 * @author Minhdaica
 */
public class Car {

    private String maHang;

    Car() {
        
    }

    public String getChiTiet() {
        return chiTiet;
    }

    public String getMaHang() {
        return maHang;
    }
    private String chiTiet;

    public void setChiTiet(String chiTiet) {
        this.chiTiet = chiTiet;
    }

    public void setMaHang(String maHang) {
        this.maHang = maHang;
    }

    Car(String Mahang) {
        this.maHang = Mahang;
    }

    public void AddNewCar() {
        Connection con = (new DBConnection()).getConnection();
        try {
            Statement stm = con.createStatement();
            stm.executeUpdate("INSERT into tbl_car " +
                    "(ma_hang,chi_tiet) " +
                    "values ('" + maHang + "', '" + chiTiet + "')");


        } catch (Exception e) {
        }
    }
    private String pa;
    
}
